package com.own.business.sync.trigger.base.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * AutoSyncTriggerConfig
 *
 * @author chenxueli
 * @date 2024-01-08 16:52:00
 */
@Slf4j
@SpringBootConfiguration
public class AutoSyncTriggerConfig {

    @Bean
    @ConditionalOnMissingBean(SyncTriggerMethod.class)
    public SyncTriggerMethod syncTriggerMethod() {
        return (targetId, type, moduleName, oldStatus, newStatus) -> {
            log.warn("未配置 SyncTriggerMethod 实现类，无法触发同步");
        };
    }

}
